//
//  PingFM.h
//  Pingr
//
//  Created by James Durkee on 5/3/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#define API_KEY @"b9d6ac8c98d51ea5a37f455cbe1479f3"
#define ROOT_URL @"http://api.ping.fm/v1/"
#define DEBUG 1


@interface PingFM : NSObject {
	id delegate;
	NSString *apiKey;
	NSString *userKey;
}
@property (retain,readwrite) NSString *userKey;
@property (retain,readonly) NSString *apiKey;

- (id)initWithUserKey:(NSString *)key;

- (void)setDelegate:(id)d;
- (id)delegate;

- (BOOL)validate;
- (NSArray *)services;
- (NSArray *)triggers;
- (NSArray *)latest;

- (BOOL)simplePost:(NSString *)body withPostMethod:(NSString *)postMethod;
- (BOOL)simplePost:(NSString *)body withTrigger:(NSString *)trigger;

- (BOOL)post:(NSString *)body 
  postMethod:(NSString *)postMethod 
	   title:(NSString *)title 
	 service:(NSString *)service 
	location:(NSString *)location 
	   media:(NSData *)media 
	encoding:(NSString *)encoding 
	 exclude:(NSString *)exclude  
	checksum:(NSString *)checksum;

- (BOOL)post:(NSString *)body 
 withTrigger:(NSString *)triggers
	   title:(NSString *)title
	location:(NSString *)location 
	   media:(NSData *)media 
	encoding:(NSString *)encoding 
	 exclude:(NSString *)exclude 
	checksum:(NSString *)checksum;

- (NSXMLDocument *)requestMethod:(NSString *)method parameters:(NSMutableDictionary *)parameters;
@end
